package com.xxxx.controller;

import com.xxxx.pojo.Order;
import com.xxxx.pojo.Product;
import com.xxxx.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class ConsumerController {

	@Autowired
	OrderService orderService;

	@RequestMapping("/o")
	public Order getOrder(){
		return orderService.selectOr(5);
	}

	@PostMapping("/save")
	public Map<Object,Object> createP(@RequestBody Product product){
		return orderService.createP(product);
	}
}
